using System;
using System.Collections.Generic;
using Dict.DataModel;

namespace Dict.Dao
{
    public class TableUnionFightItemDao:DaoBase<TableUnionFightItem>
    {
        public override void AddPrimaryIndex(TableUnionFightItem model)
        {
            cachePrimary[model.UFItemId.ToString()] = model;
        }

        public override string GetFileName()
        {
            return "TableUnionFightItem.txt";
        }

        protected override TableUnionFightItem ParseRowData(string[] rowData)
        {
            TableUnionFightItem data = new TableUnionFightItem();
			data.UFItemId = rowData [0];
			data.ItemName = rowData [1];

            if (string.IsNullOrEmpty(rowData[2]))
            {
                data.ItemType = 0;
            }
            else
            {
                data.ItemType = int.Parse(rowData[2]);
            }
			data.ItemSelector = rowData [3];
			data.ItemEffect = rowData [4];
			data.ItemUseCondition = rowData [5];

            if (string.IsNullOrEmpty(rowData[6]))
            {
                data.ItemUseCD = 0;
            }
            else
            {
                data.ItemUseCD = double.Parse(rowData[6]);
            }

            if (string.IsNullOrEmpty(rowData[7]))
            {
                data.ItemCatchMaxNum = 0;
            }
            else
            {
                data.ItemCatchMaxNum = int.Parse(rowData[7]);
            }
			data.itemInfo = rowData [8];
			data.MainItemId = rowData [9];

            return data;
        }



    }

}
